package com.cplatform.cat.java8;

import java.io.File;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

public class EnterClass {
    public static void main(String[] args) {
        List<Apple> inventory = Arrays.asList(new Apple(80,"green"),
                new Apple(155, "green"),
                new Apple(120, "red"));
        Applepredicate a = apple -> apple.getWeight()>150?"重":"轻";
        prettyPrintApple(inventory, EnterClass::test);
        new Thread(new Runnable() {
            @Override
            public void run() {

            }
        }).start();
        inventory.size();

        preocess(()->{});

    }
    public static List<Apple> prettyPrintApple(List<Apple> inventory,Applepredicate applepredicate) {
        List<Apple> result = new ArrayList<Apple>();
        for(Apple apple: inventory){
            String output = applepredicate.test(apple);
            System.out.println(output);
        }
        return result;
    }
    public static void preocess(Runnable runnable){
        runnable.run();
    }
    public static String test(Apple apple){
        return "";
    }

}
